Optimal. Leaf size=50 \[ \frac{2 B \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{d \sqrt{a-b} \sqrt{a+b}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0353222, antiderivative size = 50, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115, Rules used = {21, 2659, 205} \[ \frac{2 B \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{d \sqrt{a-b} \sqrt{a+b}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 2659
Rule 205
Rubi steps
\begin{align*} \int \frac{a B+b B \cos (c+d x)}{(a+b \cos (c+d x))^2} \, dx &=B \int \frac{1}{a+b \cos (c+d x)} \, dx\\ &=\frac{(2 B) \operatorname{Subst}\left (\int \frac{1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{d}\\ &=\frac{2 B \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b} d}\\ \end{align*}
Mathematica [A] time = 0.0362841, size = 49, normalized size = 0.98 \[ -\frac{2 B \tanh ^{-1}\left (\frac{(a-b) \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{b^2-a^2}}\right )}{d \sqrt{b^2-a^2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.102, size = 45, normalized size = 0.9 \begin{align*} 2\,{\frac{B}{d\sqrt{ \left ( a-b \right ) \left ( a+b \right ) }}\arctan \left ({\frac{\tan \left ( 1/2\,dx+c/2 \right ) \left ( a-b \right ) }{\sqrt{ \left ( a-b \right ) \left ( a+b \right ) }}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.51127, size = 409, normalized size = 8.18 \begin{align*} \left [-\frac{\sqrt{-a^{2} + b^{2}} B \log \left (\frac{2 \, a b \cos \left (d x + c\right ) +{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt{-a^{2} + b^{2}}{\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right )}{2 \,{\left (a^{2} - b^{2}\right )} d}, \frac{B \arctan \left (-\frac{a \cos \left (d x + c\right ) + b}{\sqrt{a^{2} - b^{2}} \sin \left (d x + c\right )}\right )}{\sqrt{a^{2} - b^{2}} d}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.39676, size = 105, normalized size = 2.1 \begin{align*} \frac{2 \,{\left (\pi \left \lfloor \frac{d x + c}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{\sqrt{a^{2} - b^{2}}}\right )\right )} B}{\sqrt{a^{2} - b^{2}} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]